import Vue from 'vue'
import Router from 'vue-router'
// import Home from '../pages/Home/Home'
import City from '../pages/city/City'
import Detail from '../pages/detail/Detail'

Vue.use(Router)

export const constantRouterMap = [{
		path: '/', 
		hidden: true,
		name:'Home',
		// component:Home
		// component: () => import('../pages/Home/Home')
		component:resolve => require(['../pages/Home/Home.vue'], resolve)//异步加载组件
	},{
		path: '/city', 
		component:City, 
		hidden: true
	},{
		path:'/detail/:id',
		component:Detail,
		hidden:true
	}]

export default new Router({
  	routes: constantRouterMap,
  	scrollBehavior (to, from, savedPosition) {
	  	return { x: 0, y: 0 }
	}
})